function wf = wf(pm,x,e,w,r)

wf = ((pm.bc(r)./(x.*e).^pm.phi).^(1-pm.nu) + pm.bp(r).^(1-pm.nu)).^(1./(1-pm.nu)).*w;